home *** CD-ROM | disk | FTP | other *** search
- MAXVAL(3I) Last changed: 4-13-99
-
-
- NNAAMMEE
- MMAAXXVVAALL - Returns the maximum value in an array
-
- SSYYNNOOPPSSIISS
- MMAAXXVVAALL (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- UNICOS, UNICOS/mk, IRIX systems
-
- CF90, MIPSpro 7 Fortran 90
-
- SSTTAANNDDAARRDDSS
- Fortran
-
- DDEESSCCRRIIPPTTIIOONN
- The MMAAXXVVAALL intrinsic function can be used for array reduction. It
- returns the maximum value of the elements of _a_r_r_a_y along dimension _d_i_m
- corresponding to the true elements of _m_a_s_k. It accepts the following
- arguments:
-
- _a_r_r_a_y Must be of type integer or real. It must not be scalar.
-
- _d_i_m Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
- where _n is the rank of _a_r_r_a_y. The corresponding actual
- argument must not be an optional dummy argument.
-
- _m_a_s_k This optional argument must be of type logical and must be
- conformable with _a_r_r_a_y.
-
- MMAAXXVVAALL is a transformational intrinsic function. The name of this
- intrinsic cannot be passed as an argument.
-
- NNOOTTEESS
- On UNICOS systems, both execution speed and the number of bits used in
- mathematical operations are affected when compiling with
- ff9900 --OO ffaassttiinntt, which is the default setting. For more information,
- see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
-
- RREETTUURRNN VVAALLUUEESS
- The result is of the same type as _a_r_r_a_y. It is scalar if _d_i_m is
- absent or _a_r_r_a_y has rank one. Otherwise, the result is an array of
- rank _n-1 and of shape
- (_d , _d , ..., _d , _d , ..., _d ),
- 1 2 _d_i_m-1 _d_i_m+1 _n
- where (_d , _d , ..., _d )
- 1 2 _n
- is the shape of _a_r_r_a_y.
-
- The result of MMAAXXVVAALL((_a_r_r_a_y)) has a value equal to the maximum value of
- all the elements of _a_r_r_a_y or has the value of the negative number of
- the largest magnitude supported for numbers of the data type of _a_r_r_a_y
- if _a_r_r_a_y is a zero-sized array.
-
- The result of MMAAXXVVAALL((_a_r_r_a_y,,MMAASSKK==_m_a_s_k) has a value equal to the maximum
- value of all the elements of _a_r_r_a_y corresponding to true elements of
- _m_a_s_k or has the value of the negative number of the largest magnitude
- supported for numbers of the data type of _a_r_r_a_y if there are no true
- elements.
-
- If _a_r_r_a_y has rank one, MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) has a value equal to
- that of MMAAXXVVAALL(_a_r_r_a_y[,,MMAASSKK=_m_a_s_k]). Otherwise, the value of element
- (_s , _s , ..., _s , _s , ..., _s )
- 1 2 _d_i_m-1 _d_i_m+1 _n
- of MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) is equal to
- MMAAXXVVAALL(_a_r_r_a_y(_s , _s , ..., _s , : , _s , ..., _s )
- 1 2 _d_i_m-1 _d_i_m+1 _n
- [,, MMAASSKK==_m_a_s_k((_s , _s , ..., _s , : , _s , ..., _s )]).
- 1 2 _d_i_m-1 _d_i_m+1 _n
-
- On UNICOS and UNICOS/mk systems, MMAAXXVVAALL returns the value of
- --HHUUGGEE((_a_r_r_a_y)) for all zero-sized arrays. On IRIX systems, MMAAXXVVAALL
- returns the value of --IINNFFIINNIITTYY for real, zero-sized arrays. A request
- for interpretation of the Fortran 95 standard may change one of these
- return values for a real array in a future release.
-
- EEXXAAMMPPLLEESS
- Example 1: The value of MMAAXXVVAALL(( ((// 11,, 22,, 33 //)) )) is 3.
-
- Example 2: Assume that C is the array [10,-100,10]. Then
- MMAAXXVVAALL((CC,, MMAASSKK==CC ..LLTT.. 00..00)) finds the maximum of the negative elements
- of C (which is -100) and MMAAXXVVAALL((CC,, MMAASSKK==CC ..GGTT.. 1100)) returns a negative
- number of the largest possible integer because there are no true
- elements using the mask.
-
- Example 3: Assume that BB is the following array:
-
- | 1 3 5 |
-
- | 2 4 6 |
-
- The following are true:
-
- MMAAXXVVAALL((BB,, DDIIMM==11)) is [2, 4, 6]
-
- MMAAXXVVAALL((BB,, DDIIMM==22)) is [5, 6]
-
- MMAAXXVVAALL((BB)) is 6
-
- Example 4: Assume that NN is the following array:
-
- | 0 1 2 3 |
-
- | 4 5 6 7 |
-
- | 8 9 0 1 |
-
- The following are true:
-
- MMAAXXVVAALL((NN((22::33,,22::44)),,MMAASSKK==NN((22::33,,22::44))..NNEE..00)) is 9
-
- MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==11,,NN((22::33,,22::44))..NNEE..00)) is [9, 6, 7]
-
- MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==22,,NN((22::33,,22::44))..NNEE..00)) is [7, 9]
-
- SSEEEE AALLSSOO
- _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
- man page.
-